﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Top.Api.Response;
using Top.Api;
using System.Configuration;
using Top.Api.Request;
using Top.Api.Domain;
using TopModel;

/// <summary>
///WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。 
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {

    public WebService () {

        //如果使用设计的组件，请取消注释以下行 
        //InitializeComponent(); 
    }

    [WebMethod]
    public int ImportData(string nick)
    {
        TopTradeHelper tradeHelper=new TopTradeHelper();
        DateTime startDate = tradeHelper.GetLastImportTime(nick);
        int status = 0;
        status = tradeHelper.ImportData(Session["TopSession"].ToString(), startDate, DateTime.Now);
        return status;
    }
}
